@extends('assets.master')

@section('page-title', "文章列表")

@section('page-content')
    <!-- 图片轮播-->
    <div id="myCarousel" class="carousel slide masthead">
        <ol class="carousel-indicators">
            <li data-target="#myCarousel" data-slide-to="0" class="active"></li>
            <li data-target="#myCarousel" data-slide-to="1"></li>
            <li data-target="#myCarousel" data-slide-to="2"></li>
        </ol>
        <div class="carousel-inner">
            <div class="item active">
                <img src="{{ url("/assets/demoyy/img/carousel-1.jpg") }}" alt="">
                <div class="carousel-caption">
                    <h4>标题一</h4>
                    <p>图片一内容简介</p>
                </div>
            </div>
            <div class="item">
                <img src="{{ url("/assets/demoyy/img/carousel-1.jpg") }}" alt="">
                <div class="carousel-caption">
                    <h4>标题二</h4>
                    <p>图片二内容简介</p>
                </div>
            </div>
            <div class="item">
                <img src="{{ url("/assets/demoyy/img/carousel-1.jpg") }}" alt="">
                <div class="carousel-caption">
                    <h4>标题三</h4>
                    <p>图片三内容简介</p>
                </div>
            </div>
        </div>
        <a class="left carousel-control" href="#myCarousel" data-slide="prev"><</a>
        <a class="right carousel-control" href="#myCarousel" data-slide="next">></a>
    </div>
    <!--END CAROUSEL-->

    <!--图片轮播底部-->
    <div class="masthead-foot">
        <div class="container">
            <ul class="list-inline divider-vertical">
                <li><a href="#">这里是测试</a></li>
                <li><a href="#">这里是测试</a></li>
                <li><a href="#">这里是测试</a></li>
            </ul>
        </div>
    </div>
    <!--EDN masthead-foot-->

    <div class="content container">
        <!--文章列表页-->
        <div class="row">
            <div class="col-sm-12 col-md-9">

                @foreach($articles as $article)
                    <div class="panel panel-default panel-list">
                        <div class="panel-heading"><a href="{{ url('posts', ['id' => $article->post_id]) }}"><h2>{{ $article->post_title }}</h2></a></div>
                        <div class="logo-hack">
                            <div class="logo-center circle"></div>
                            <div class="char-d">
                                <div class="l-d"></div>
                                <div class="s-d"></div>
                            </div>
                        </div>
                        <div class="panel-body">
                            <div class="row">
                                <div class="col-sm-6 col-md-4">
                                    <a href="{{ url('posts', ['id' => $article->post_id]) }}" class="thumbnail">
                                        <img src="{{ $article->post_cover }}" style="" alt="">
                                    </a>
                                </div>
                                <div class="col-sm-6 col-md-8">
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{ $article->post_intro }}
                                </div>
                            </div>
                        </div>
                        <div class="panel-footer">
                            <div class="left-tags hidden-xs"><span class="glyphicon glyphicon-user glyphicon-lt"></span> {{ $article->hasOneUser->name }}</div>
                            <div class="left-tags"><span class="glyphicon glyphicon-calendar glyphicon-lt"></span> {{ $article->published_at }}</div>
                            <div class="pull-right">
                                <a href="{{ url('posts', ['id' => $article->post_id]) }}" class="more-link"><span><i>阅读全文</i></span></a>
                            </div>
                        </div>
                    </div>
                @endforeach

                {!! $articles->render() !!}

                @if ($articles[0] == null)
                    <h1 class="text-center" style="color: #f4645f; margin: 0 0 30px 0;">您让臣妾搜的 "{{ Request::input('keyword') }}" </h1>
                    <div class="thumbnail col-md-offset-4 col-md-4">
                        <img src="{{ url("/assets/demoyy/img/search-not-found.jpeg") }}">
                    </div>
                @endif

            </div>
            <!--EDN article lists-->
@endsection